]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Remove dragMonitor when FolderIcon is destroyed
authorJonas Dreßler <verdre@v0yd.nl>
Sat, 23 Nov 2019 18:57:02 +0000 (19:57 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 27 Mar 2020 22:38:41 +0000 (22:38 +0000)
While it should be impossible to destroy a FolderIcon while a DnD action
is still going on, there might still be rare cases where this happens
(ie. when a folder is removed because an app got deleted during DnD).

So make sure we're on the safe side here and don't potentially leave
dragMonitors around after the icon is destroyed by removing the
dragMonitor inside the onDestroy handler of the FolderIcon, just like we
do for AppIcons.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/849

js/ui/appDisplay.js

index 62a99b9fe9925be7153588e2de21385072f96d25..0621acdae41a98c7cb8af0902efab948ef2a3153 100644 (file)
@@ -1515,6 +1515,11 @@ var FolderIcon = GObject.registerClass({
         Main.overview.disconnect(this._itemDragBeginId);
         Main.overview.disconnect(this._itemDragEndId);
 
+        if (this._dragMonitor) {
+            DND.removeDragMonitor(this._dragMonitor);
+            this._dragMonitor = null;
+        }
+
         this.view.destroy();
 
         if (this._folderChangedId) {